//
//  NetWorkHelp.m
//  YunMedical
//
//  Created by hysoft on 2018/8/27.
//  Copyright © 2018年 hysoft. All rights reserved.
//

#import "NetWorkHelp.h"

@implementation NetWorkHelp
+ (void)yl_getDataWith:(NSMutableDictionary *)params
                   url:(NSString *)url
               success:(void(^)(id respose))success
               failure:(void (^)(NSError *error))failure {
    
    BADataEntity *entity = [BADataEntity new];
    entity.urlString = url;
    entity.parameters = params;
    [BANetManager ba_request_GETWithEntity:entity successBlock:^(id response) {
        success(response);
    } failureBlock:^(NSError *error) {
        failure(error);
    } progressBlock:nil];
    
}


+ (void)yl_postDataWith:(NSMutableDictionary *)params
                    url:(NSString *)url
                success:(void(^)(id respose))success
                failure:(void (^)(NSError *error))failure {
    
    BADataEntity *entity = [BADataEntity new];
    entity.urlString = url;
    entity.parameters = params;
    [BANetManager ba_request_POSTWithEntity:entity successBlock:^(id response) {
        
        success(response);
        
    } failureBlock:^(NSError *error) {

        failure(error);
        
    } progressBlock:nil];
}






@end
